<template>
  <div class="item-bg home">
    <!-- <div class="show-random">{{ msg }}</div> -->
    <button class="but" @click="Send"></button>
  </div>
</template>
<style src="../image.css"></style>
<script setup>
import { ref } from "vue";
import initData from "../../initData"
const { socket} = initData(true);
import bus from '../../utils/bus';
const msg=ref('');
//收到数据并进行显示
  bus.on('sendMsg', (data) => {
   msg.value = data
  })
function Send() {
  socket.send({test:123}, () => {
   // console.log('点击后可发送指令')
  })
}
</script>

<style lang="scss">

.home {
  background-image: url('/images/bg.png');
}

.show-random {
  position: absolute;
  top: 30px;
  left: 80px;
  width: 50px;
  height: 50px;
  line-height: 50px;
  border: 1px solid red;
  color: #fe0606;
}

.but {
  width: 100px;
  height: 45px;
}
</style>
